#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 1e6 + 10;

namespace pot {
	ll b[N], tot;
	void ins(ll x) { b[++tot] = x; }
	void build() { sort(b + 1, b + tot + 1), tot = unique(b + 1, b + tot + 1) - b - 1; }
	int query(ll x) { return lower_bound(b + 1, b + tot + 1, x) - b; }
};

struct T {
	ll tr[N]; int sz;
	void add(int x, ll v) { for(; x <= sz; x += x & -x) tr[x] += v; }
	ll query(int x) { ll tot = 0; for(; x; x -= x & -x) tot += tr[x]; return tot; }
	void add(int l, int r, ll v) { if(l > r) return; add(r + 1, -v), add(l, v);  }
} T1, T2;

int n, Q, a[N], p[N];
ll ans[N], curp[N];

int main() {
#ifdef YJR_2333_TEST
	freopen("1.in", "r", stdin);
#endif
	n = in, Q = in; rep(i, 1, Q) a[i] = in, p[i] = in, curp[a[i]] += p[i], pot :: ins(curp[a[i]]);
	pot :: ins(0); pot :: build(); T1.sz = T2.sz = pot :: tot;
	int pos0 = pot :: query(0); rep(i, 1, n) curp[i] = pos0;
	T1.add(pos0, n);
	rep(i, 1, Q) {
		int lval = curp[a[i]], nval = pot :: query(pot :: b[lval] + p[i]);
		int lrk = n - T1.query(lval) + 1; T1.add(lval, -1), T1.add(nval, 1);
		int nrk = n - T1.query(nval) + 1; ans[a[i]] += abs(nrk - lrk) + T2.query(lval); 
		if(lval < nval) T2.add(lval, nval - 1, 1);
		if(lval > nval) T2.add(nval, lval - 1, 1);
		curp[a[i]] = nval; ans[a[i]] -= T2.query(nval);
	} rep(i, 1, n) printf("%lld\n", ans[i] + T2.query(curp[i]));
	return 0;
}
